#include <stdio.h>
//#include "constants.h"

double E0y(double _xg,double _t,double _xgleft, double _wp,double _kp,double _E0,double _k0,double _w0);
void CalculaRo(double _xp[], int _np, int _npion, double _ro[], int _ndg,double _qp[],double _deltag, int _na, FILE *fp0);
void CalculaRo_history(double _xp[], int _np, int _npion, double _ro[], int _ndg,double _qp[],double _deltag, int _na, FILE *fp0,int _n);
void CalculaJ(int _label, double _xp[],double _vpx[], double _vpy[],double _vpz[],int _np,int _npion,double _Jx[],double _Jy[],double _Jz[],int _ndg,double _qp[],double _deltat,double _deltag, int _na, FILE *fp0, FILE *fp1);

double E0x(double _xg, double _t);
double E0y(double _xg,double _t,double _xgleft, double _wp,double _kp,double _E0,double _k0,double _w0);
double E0z(double _xg, double _t);
double B0x(double _xg,double _t);
double B0y(double _xg,double _t);
double B0z(double _xg,double _t,double _xgleft, double _wp,double _kp,double _E0,double _k0,double _w0);
void CalculaEx(double _Ex[], double _Phi[], double _DAx[], int _ndg, double _t,double _deltag,double _deltat, FILE *fp0);
void CalculaEy(double _Ey[],double _DAy[],int _ndg,double _t,double _deltag,double _deltat, double _xg,double _xgleft, double _wp,double _kp,double _E0,double _k0,double _w0);
void CalculaEz(double _Ez[],double _DAz[],int _ndg, double _t,double _deltag,double _deltat);
void CalculaBy(double _By[],double _Az[], int _ndg, double _t,double _deltag,double _deltat);
void CalculaBz(double _Bz[],double _Ay[],int _ndg,double _t,double _deltag,double _deltat,double _xg,double _xgleft, double _wp,double _kp,double _E0,double _k0,double _w0);
void interpola(double _x,double _Ex[],double _Ey[],double _Ez[],double _By[],double _Bz[],double &_Epx,double &_Epy,double &_Epz,double &_Bpx,double &_Bpy,double &_Bpz, double _t,int _ndg,double _deltag, int _na, FILE *fp0);
void ParticleMover(double _xp[],int j, double _vpx[],double _vpy[],double _vpz[],double _Epx,double _Epy,double _Epz,double _Bpx,double _Bpy,double _Bpz, double _deltat, double ae);
//Start with the object version supposedly more compact

/*double oE0y(double _xg,double _t,double _xgleft, laser _laser1);
void oCalculaRo(grid_object _xp, int _npion, grid_object _ro ,grid_object _qp, int _na, FILE *fp0);
void oCalculaRo_history(grid_object _xp, int _npion, grid_object _ro[], grid_object _qp[], int _na, FILE *fp0,int _n);
void oCalculaJ(int _label, double _xp[],grid_object _vp[],int _npion, grid_object _J[], grid_object _qp, int _na, FILE *fp0);

double oE0x(double _xg, double _t);
double oE0y(double _xg,double _t,double _xgleft, laser laser1);
double oE0z(double _xg, double _t);
double oB0x(double _xg,double _t);
double oB0y(double _xg,double _t);
double oB0z(double _xg,double _t,double _xgleft, laser laser1);
void oCalculaEx(grid_object _Ex, grid_object _Phi, grid_object _DAx, grid_object _t);
void oCalculaEy(double _Ey[],double _DAy[],int _ndg,double _t,double _deltag,double _deltat, double _xg,double _xgleft, laser _laser1);
void oCalculaEz(double _Ez[],double _DAz[],int _ndg, double _t,double _deltag,double _deltat);
void oCalculaBy(double _By[],double _Az[], int _ndg, double _t,double _deltag,double _deltat);
void oCalculaBz(double _Bz[],double _Ay[],int _ndg,double _t,double _deltag,double _deltat,double _xg,double _xgleft, laser _laser1);
void ointerpola(double _x,double _Ex[],double _Ey[],double _Ez[],double _By[],double _Bz[],double _Epx,double _Epy,double _Epz,double _Bpx,double _Bpy,double _Bpz, double _t,int _ndg,double _deltag, int _na);
*/
